package com.hbt.en_rem_hou.controller;

import com.hbt.en_rem_hou.service.FeatureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Transactional
public class FeatureController {
    @Autowired
    FeatureService featureService;

    @PostMapping("/deleteFeature")
    public boolean deleteFeatureByDescriptAndWordId(@RequestParam("descript") String descript, @RequestParam("wordid")int wordid){
        return featureService.deleteFeatureByDescriptAndWordId(descript,wordid);
//        return true;
    }

    @PostMapping("/addFeature")
    public boolean addFeatureByDescriptAndWordid(@RequestParam("descript") String descript, @RequestParam("wordid")int wordid){
        return featureService.addFeatureByDescriptAndWordid(descript, wordid);
//        return false;
    }
}
